<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户编译</title>
<script type="text/javascript">
Ext.onReady(function(){
 var editUserFormPanel=Ext.create('Ext.form.Panel',{
		renderTo: 'editUserFormDiv',
        labelWidth: 60,
        border: false,
        bodyStyle: 'background-color:transparent;',
        url: '/',
        items: [{
            border: false,
            bodyStyle: 'padding:5px;background-color:transparent;',
            items:[{// 账号
            	xtype:'textfield',
            	id:'user',	
                fieldLabel: '账号',
                anchor:'95%',
                readOnly: true,
                maxLength: 20
           },{// 姓名
        	   xtype:'textfield',
        	   id:'name',
               fieldLabel:'姓名',
               anchor:'95%',
               allowBlank:false,
               maxLength: 20
           },{// 年龄
        	   xtype:'textfield',
        	   id:'age',
               fieldLabel:'年龄',
               anchor:'95%',
               allowBlank:false,
               maxLength: 20
            },{// 生日
                xtype:'datefield',
                id: 'birthdayStr',
                name: 'birthdayStr',
                fieldLabel: '生日',
                format: 'Y-m-d',
                anchor:'95%'
            },{// 邮箱
               xtype:'textfield',
               id:'email',
               name:'email',
               fieldLabel:'邮箱',
               anchor:'95%',
               allowBlank:false,
               vtype:'email',
               maxLength: 50
           },{// 电话
               xtype:'textfield',
               id:'phone',
               name:'phone',
               fieldLabel:'电话',
               anchor:'95%',
               maxLength: 20
           }],

            // Reset and Submit buttons
            buttons: [
            {
                text: '确定',   
                handler: function() {
                    var form = this.up('form').getForm();
                    if (form.isValid()) {
                    	// 发送请求
                    }
                }
            }]
        }]
    });
	
	  // 发送请求-form初期化
	MyExt.ajaxRequest({
		baseUrl: '',
		action: '../json/editUser.jsp',
		callback: function(jsonResult){
			editUserFormPanel.getForm().setValues(jsonResult);
			//var basicForm = editUserFormPanel.getForm();
			//basicForm.findField('user').setValue('admin');
			
		}
	});

	
});

</script>
</head>
<body>
<div id="editUserDiv" style="width:100%;height:100%;">
	<div id="editUserToolBarDiv"></div>
	<div id="editUserFormDiv"></div>
</div>
</body>
</html>